import request from '@/utils/request'

export function query() {
    return request({
      url: '/article/tags',
      method: 'get'
    })
  }

export function uploadApiImge(file) {
    return request ({
      url: '/article/image',
      method: 'post',
      data:file
    })
}

export function addArticle(data) {
    return request({
      url: '/article/addArticle',
      method: 'post',
      data:data
    })
}

export function listArticle() {
  return request ({
    url: '/article/listArticle',
    method: 'get',
  })
}


export function listArticleByUserId() {
  return request ({
    url: '/article/listArticleByUserId',
    method: 'get',
  })
}

export function changeStatus(articleId,status) {
  return request ({
    url: '/article/changeStatus/'+articleId+'/'+status,
    method: 'post',
    
  })
}

export function queryArticleById(id) {
  return request({
    url: '/article/'+id,
    method: 'get',
  })
}

export function updateArticle() {
  return request({
    url: '/article/updateArticle',
    method: 'post',
    data:data
  })
}

export function commentsArticle(articleId,content) {
  return request({
    url:'/article/commentsArticle',
    method:'post',
    data:{articleId:articleId,content:content}
  })
}